package com.qfedu.gytv.controller;

import com.qfedu.gytv.vo.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.qfedu.gytv.entity.Text;
import com.qfedu.gytv.service.intf.TextService;

/**
 * @description: 码起 自动生成代码
 * @author: my
 * @create: 2020-09-16 20:06:51
 */
@Api(value = "文章相关操作", tags = "文章相关操作")
@RestController
@RequestMapping("/text")
public class TextController {
    @Autowired
    private TextService tbTextService;

    @RequestMapping(value = "/add.do", method = RequestMethod.POST)
    public R save(@RequestBody Text text) {
        return tbTextService.save(text);
    }

    @RequestMapping(value = "/del.do", method = RequestMethod.DELETE)
    public R del(int id) {
        return tbTextService.delById(id);
    }

    @RequestMapping(value = "/all.do", method = RequestMethod.GET)
    public R all(){
        return tbTextService.all();
    }
}
